import * as bcrypt from 'bcrypt'

async function genHash() {
  const password = '123456'
  const salt1 = bcrypt.genSaltSync(10)
  const salt2 = bcrypt.genSaltSync(10)

  console.log('salt1', salt1)
  console.log('salt2', salt2)

  const hash1 = bcrypt.hashSync(password, salt1)
  const hash2 = bcrypt.hashSync(password, salt2)

  console.log('hash1', hash1)
  console.log('hash2', hash2)

  const isMatch1 = bcrypt.compareSync(password, hash1)

  console.log('isMatch1', isMatch1)

  const isMatch2 = bcrypt.compareSync(password, hash2)

  console.log('isMatch2', isMatch2)
}
genHash()
